Content On This Page | ||
---|---|---|
Derivation of the Distance Formula in 3D | Calculating Distance Between Two Points in 3D Space | Applications in 3D Geometry |
Distance Formula in Three Dimensions
Derivation of the Distance Formula in 3D
In two-dimensional coordinate geometry, the distance formula is derived using the Pythagorean theorem. The distance formula in three dimensions is a natural extension of this concept, applying the Pythagorean theorem twice in a 3D space. It provides a way to calculate the straight-line distance between any two points in space given their Cartesian coordinates.
Setup
Let $P_1$ and $P_2$ be two points in three-dimensional space with coordinates $P_1(x_1, y_1, z_1)$ and $P_2(x_2, y_2, z_2)$. Our objective is to find the distance between these two points, denoted as $d$ or $|P_1 P_2|$.
To find this distance, we construct a right-angled triangle in 3D space where the segment $P_1 P_2$ is the hypotenuse. We can do this by considering the changes in the x, y, and z coordinates separately.
Construction and Derivation using Pythagorean Theorem
Consider the points $P_1(x_1, y_1, z_1)$ and $P_2(x_2, y_2, z_2)$. Let's define an intermediate point $Q$ such that it shares the x and y coordinates of $P_2$ but the z-coordinate of $P_1$. The coordinates of $Q$ are $Q(x_2, y_2, z_1)$.

Now consider the line segments $P_1 Q$ and $Q P_2$.
-
Segment $P_1 Q$: This segment connects $P_1(x_1, y_1, z_1)$ and $Q(x_2, y_2, z_1)$. Since the z-coordinates of $P_1$ and $Q$ are the same ($z_1$), the segment $P_1 Q$ is parallel to the XY-plane (specifically, it lies in the plane $z = z_1$). The length of this segment is equivalent to the distance between the points $(x_1, y_1)$ and $(x_2, y_2)$ in a 2D plane. Using the 2D distance formula:
$|P_1 Q| = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$
... (i)
Squaring both sides of equation (i) gives:
$|P_1 Q|^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2$
... (ii)
-
Segment $Q P_2$: This segment connects $Q(x_2, y_2, z_1)$ and $P_2(x_2, y_2, z_2)$. Since the x and y coordinates of $Q$ and $P_2$ are the same ($x_2$ and $y_2$), the segment $Q P_2$ is parallel to the z-axis. The length of this segment is the absolute difference in the z-coordinates:
$|Q P_2| = |z_2 - z_1|$
... (iii)
Squaring both sides of equation (iii) gives:
$|Q P_2|^2 = (z_2 - z_1)^2$
... (iv)
-
Triangle $P_1 Q P_2$: Now consider the triangle formed by the points $P_1$, $Q$, and $P_2$. The segment $P_1 Q$ lies in the plane $z = z_1$, which is parallel to the XY-plane. The segment $Q P_2$ is parallel to the z-axis, meaning it is perpendicular to any plane parallel to the XY-plane, including the plane $z = z_1$. Therefore, the segment $Q P_2$ is perpendicular to the segment $P_1 Q$. This means $\triangle P_1 Q P_2$ is a right-angled triangle with the right angle at point $Q$. The hypotenuse of this triangle is the segment $P_1 P_2$, whose length is the distance we want to find.
-
Applying the Pythagorean Theorem: In the right-angled triangle $\triangle P_1 Q P_2$, according to the Pythagorean theorem, the square of the hypotenuse ($|P_1 P_2|^2$) is equal to the sum of the squares of the other two sides ($|P_1 Q|^2$ and $|Q P_2|^2$).
$|P_1 P_2|^2 = |P_1 Q|^2 + |Q P_2|^2$
(Pythagorean Theorem)
Substitute the expressions for $|P_1 Q|^2$ from equation (ii) and $|Q P_2|^2$ from equation (iv):
$|P_1 P_2|^2 = [(x_2 - x_1)^2 + (y_2 - y_1)^2] + (z_2 - z_1)^2$
... (v)
$|P_1 P_2|^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2$
... (vi)
-
Taking the Square Root: To find the distance $|P_1 P_2|$, take the positive square root of both sides of equation (vi):
$|P_1 P_2| = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$
... (vii)
Equation (vii) is the 3D distance formula.
Distance Formula in 3D
The distance $d$ between any two points $P_1(x_1, y_1, z_1)$ and $P_2(x_2, y_2, z_2)$ in three-dimensional space is given by:
$\mathbf{d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}}$
This formula represents the length of the line segment connecting the two points. It is the direct generalization of the 2D distance formula by adding the squared difference of the z-coordinates.
Distance of a Point from the Origin:
A special case of the 3D distance formula is finding the distance of a point $P(x, y, z)$ from the origin $O(0, 0, 0)$. Using the distance formula with $P_1(x_1, y_1, z_1) = O(0, 0, 0)$ and $P_2(x_2, y_2, z_2) = P(x, y, z)$, we get:
$|OP| = \sqrt{(x - 0)^2 + (y - 0)^2 + (z - 0)^2} = \sqrt{x^2 + y^2 + z^2}$
So, the distance of a point $(x, y, z)$ from the origin is $\mathbf{\sqrt{x^2 + y^2 + z^2}}$.
3D Distance Formula (Summary)
Formula:
Distance between $P_1(x_1, y_1, z_1)$ and $P_2(x_2, y_2, z_2)$ is:
$\mathbf{d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}}$
Derivation Basis:
Pythagorean theorem applied in three dimensions.
Distance from Origin:
Distance from $P(x, y, z)$ to $O(0, 0, 0)$ is $\mathbf{\sqrt{x^2 + y^2 + z^2}}$.
Key Idea:
The square of the distance between two points in 3D is the sum of the squares of the differences in their x, y, and z coordinates.
Calculating Distance Between Two Points in 3D Space
The 3D distance formula allows us to find the length of the straight line segment connecting any two points in three-dimensional space, provided we know their Cartesian coordinates. The formula is a direct generalization of the 2D distance formula.
Given two points $P_1(x_1, y_1, z_1)$ and $P_2(x_2, y_2, z_2)$, the distance $d$ between them is calculated using the formula:
$\mathbf{d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}}$
Alternatively, the formula can be written as $d = \sqrt{(\Delta x)^2 + (\Delta y)^2 + (\Delta z)^2}$, where $\Delta x = x_2 - x_1$, $\Delta y = y_2 - y_1$, and $\Delta z = z_2 - z_1$ are the differences in the corresponding coordinates.
Steps to Calculate Distance in 3D:
To find the distance between two points $P_1(x_1, y_1, z_1)$ and $P_2(x_2, y_2, z_2)$:
-
Identify Coordinates: Clearly note the coordinates of the two points. Let the first point be $(x_1, y_1, z_1)$ and the second point be $(x_2, y_2, z_2)$. The order of points $P_1$ and $P_2$ does not affect the final distance, as squaring the coordinate differences makes them non-negative.
-
Calculate Coordinate Differences: Subtract the corresponding coordinates of the first point from the second point. Calculate the difference in x-coordinates ($x_2 - x_1$), the difference in y-coordinates ($y_2 - y_1$), and the difference in z-coordinates ($z_2 - z_1$).
-
Square the Differences: Square each of the three differences obtained in Step 2: $(x_2 - x_1)^2$, $(y_2 - y_1)^2$, and $(z_2 - z_1)^2$. Remember that squaring a negative number results in a positive number.
-
Sum the Squared Differences: Add the three squared differences obtained in Step 3: $(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2$. The sum will always be non-negative.
-
Take the Square Root: Calculate the positive square root of the sum obtained in Step 4. This final value is the distance $d$ between the two points.
$d = \sqrt{\text{Sum from Step 4}}$
Example 1. Find the distance between the points A(1, 2, 3) and B(4, 6, -9).
Answer:
Given the coordinates of point A as $(x_1, y_1, z_1) = (1, 2, 3)$ and point B as $(x_2, y_2, z_2) = (4, 6, -9)$.
We use the 3D distance formula: $d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$.
Step 1: Calculate Coordinate Differences.
$x_2 - x_1 = 4 - 1 = 3$
... (i)
$y_2 - y_1 = 6 - 2 = 4$
... (ii)
$z_2 - z_1 = -9 - 3 = -12$
... (iii)
Step 2: Square the Differences.
$(x_2 - x_1)^2 = 3^2 = 9$
... (iv)
$(y_2 - y_1)^2 = 4^2 = 16$
... (v)
$(z_2 - z_1)^2 = (-12)^2 = 144$
... (vi)
Step 3: Sum the Squared Differences.
$(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2 = 9 + 16 + 144$
... (vii)
Simplify equation (vii):
Sum of squares $= 25 + 144 = 169$
... (viii)
Step 4: Take the Square Root.
$d = \sqrt{169}$
... (ix)
$d = 13$
... (x)
The distance between points A(1, 2, 3) and B(4, 6, -9) is $\mathbf{13 \text{ units}}$.
Example 2. Find the distance of the point P(-2, 1, 5) from the origin O(0, 0, 0).
Answer:
Given the point $P(x, y, z) = (-2, 1, 5)$ and the origin $O(0, 0, 0)$.
We can use the special case formula for the distance of a point from the origin: $|OP| = \sqrt{x^2 + y^2 + z^2}$.
Substitute the coordinates of point P into the formula:
$|OP| = \sqrt{(-2)^2 + 1^2 + 5^2}$
... (i)
Simplify the terms inside the square root:
$|OP| = \sqrt{4 + 1 + 25}$
... (ii)
Add the terms inside the square root:
$|OP| = \sqrt{30}$
... (iii)
Since $\sqrt{30}$ cannot be simplified further (30 has prime factors 2, 3, 5, none squared), we leave it in this form.
The distance of point P(-2, 1, 5) from the origin is $\mathbf{\sqrt{30} \text{ units}}$.
3D Distance Calculation (Summary)
Formula:
$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$
Steps:
- Subtract corresponding coordinates.
- Square each difference.
- Add the squares.
- Take the square root.
Distance from Origin $(0,0,0)$ to $(x,y,z)$:
$d = \sqrt{x^2 + y^2 + z^2}$
Note:
Squaring coordinate differences ensures positive contributions to the total squared distance, regardless of the order of subtraction or the signs of the coordinates themselves.
Applications in 3D Geometry
The 3D distance formula, $d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$, is a fundamental tool for solving various geometric problems in three-dimensional space. By calculating the lengths of line segments between points, we can verify geometric properties, classify figures, and solve problems involving distances.
1. Checking Collinearity of Three Points
Three points A, B, and C are collinear (lie on the same straight line) if and only if the sum of the lengths of any two of the segments formed by these points is equal to the length of the third segment. For example, if B lies between A and C on the line, then the distance from A to B plus the distance from B to C must equal the distance from A to C: $|AB| + |BC| = |AC|$.
To check if three points A, B, and C are collinear using the 3D distance formula:
- Calculate the distances between all three pairs of points: $|AB|$, $|BC|$, and $|AC|$ using the 3D distance formula.
- Check if the sum of the lengths of the two shorter segments equals the length of the longest segment. If this condition is met for any permutation of the points, they are collinear. Otherwise, they form a triangle.
Example 1. Show that the points P(-2, 3, 5), Q(1, 2, 3), and R(7, 0, -1) are collinear.
Answer:
We need to calculate the distances between each pair of points using the 3D distance formula.
Calculate $|PQ|$:
Using P$(-2, 3, 5)$ and Q$(1, 2, 3)$: $|PQ| = \sqrt{(1 - (-2))^2 + (2 - 3)^2 + (3 - 5)^2}$
$|PQ| = \sqrt{(1 + 2)^2 + (-1)^2 + (-2)^2}$
$|PQ| = \sqrt{3^2 + 1 + 4} = \sqrt{9 + 1 + 4} = \sqrt{14}$
$|PQ| = \sqrt{14}$
... (i)
Calculate $|QR|$:
Using Q$(1, 2, 3)$ and R$(7, 0, -1)$: $|QR| = \sqrt{(7 - 1)^2 + (0 - 2)^2 + (-1 - 3)^2}$
$|QR| = \sqrt{6^2 + (-2)^2 + (-4)^2}$
$|QR| = \sqrt{36 + 4 + 16} = \sqrt{56}$
We can simplify $\sqrt{56}$ since $56 = 4 \times 14$: $|QR| = \sqrt{4 \times 14} = \sqrt{4} \times \sqrt{14} = 2\sqrt{14}$
$|QR| = 2\sqrt{14}$
... (ii)
Calculate $|PR|$:
Using P$(-2, 3, 5)$ and R$(7, 0, -1)$: $|PR| = \sqrt{(7 - (-2))^2 + (0 - 3)^2 + (-1 - 5)^2}$
$|PR| = \sqrt{(7 + 2)^2 + (-3)^2 + (-6)^2}$
$|PR| = \sqrt{9^2 + 9 + 36} = \sqrt{81 + 9 + 36} = \sqrt{126}$
We can simplify $\sqrt{126}$ since $126 = 9 \times 14$: $|PR| = \sqrt{9 \times 14} = \sqrt{9} \times \sqrt{14} = 3\sqrt{14}$
$|PR| = 3\sqrt{14}$
... (iii)
Check Collinearity Condition:
The three distances are $\sqrt{14}$, $2\sqrt{14}$, and $3\sqrt{14}$. The two shorter distances are $|PQ|$ and $|QR|$. Let's check if their sum equals the longest distance $|PR|$.
$|PQ| + |QR| = \sqrt{14} + 2\sqrt{14} = (1+2)\sqrt{14} = 3\sqrt{14}$
... (iv)
From (iii) and (iv), we see that $|PQ| + |QR| = |PR|$.
Since the sum of the lengths of two segments equals the length of the third segment, the points P, Q, and R are collinear. Point Q lies between P and R.
2. Identifying Types of Triangles
Given the coordinates of the three vertices of a triangle, say A, B, and C, we can determine the type of triangle by calculating the lengths of its sides $|AB|$, $|BC|$, and $|CA|$ using the 3D distance formula. Then, we compare these lengths and their squares.
- Scalene Triangle: All three sides have different lengths ($|AB| \neq |BC|$, $|BC| \neq |CA|$, and $|CA| \neq |AB|$).
- Isosceles Triangle: At least two sides have equal lengths (e.g., $|AB| = |BC|$).
- Equilateral Triangle: All three sides have equal lengths ($|AB| = |BC| = |CA|$).
- Right-Angled Triangle: The triangle is right-angled if the converse of the Pythagorean theorem holds true. This means the square of the length of the longest side is equal to the sum of the squares of the lengths of the other two sides (e.g., if $|AC|$ is the longest side, check if $|AB|^2 + |BC|^2 = |AC|^2$).
Example 2. Show that the points A(0, 7, 10), B(-1, 6, 6), and C(-4, 9, 6) form an isosceles right-angled triangle.
Answer:
We calculate the squares of the lengths of the sides of $\triangle ABC$ using the 3D distance formula squared, $d^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2$.
Calculate $|AB|^2$:
Using A$(0, 7, 10)$ and B$(-1, 6, 6)$: $|AB|^2 = (-1 - 0)^2 + (6 - 7)^2 + (6 - 10)^2$
$|AB|^2 = (-1)^2 + (-1)^2 + (-4)^2 = 1 + 1 + 16 = 18$
$|AB|^2 = 18$
... (i)
Calculate $|BC|^2$:
Using B$(-1, 6, 6)$ and C$(-4, 9, 6)$: $|BC|^2 = (-4 - (-1))^2 + (9 - 6)^2 + (6 - 6)^2$
$|BC|^2 = (-4 + 1)^2 + 3^2 + 0^2 = (-3)^2 + 9 + 0 = 9 + 9 = 18$
$|BC|^2 = 18$
... (ii)
Calculate $|CA|^2$:
Using C$(-4, 9, 6)$ and A$(0, 7, 10)$: $|CA|^2 = (0 - (-4))^2 + (7 - 9)^2 + (10 - 6)^2$
$|CA|^2 = (0 + 4)^2 + (-2)^2 + 4^2 = 4^2 + 4 + 16 = 16 + 4 + 16 = 36$
$|CA|^2 = 36$
... (iii)
Check for Isosceles Property:
From equations (i) and (ii), we have $|AB|^2 = 18$ and $|BC|^2 = 18$. This means $|AB| = \sqrt{18}$ and $|BC| = \sqrt{18}$. Since $|AB| = |BC|$, the triangle has two sides of equal length.
Therefore, $\triangle ABC$ is an isosceles triangle.
Check for Right-Angled Property:
The side lengths squared are 18, 18, and 36. The longest side is the one with the largest square length, which is $|CA|^2 = 36$. The sum of the squares of the other two sides is $|AB|^2 + |BC|^2 = 18 + 18 = 36$.
$|AB|^2 + |BC|^2 = 36$
... (iv)
$|CA|^2 = 36$
... (v)
From (iv) and (v), we see that $|AB|^2 + |BC|^2 = |CA|^2$. This satisfies the converse of the Pythagorean theorem.
Therefore, $\triangle ABC$ is a right-angled triangle, with the right angle at vertex B (the vertex opposite the longest side CA).
Since $\triangle ABC$ is both isosceles and right-angled, the points A(0, 7, 10), B(-1, 6, 6), and C(-4, 9, 6) form an isosceles right-angled triangle.
3. Identifying Types of Quadrilaterals
Given the coordinates of four vertices A, B, C, and D, we can classify the quadrilateral formed by these points by calculating the lengths of all four sides ($|AB|, |BC|, |CD|, |DA|$) and the lengths of the two diagonals ($|AC|, |BD|$).
- Parallelogram: Opposite sides are equal in length ($|AB| = |CD|$ and $|BC| = |DA|$). The diagonals generally have different lengths.
- Rectangle: A parallelogram with equal diagonals. So, opposite sides are equal ($|AB| = |CD|$ and $|BC| = |DA|$), and the diagonals are equal ($|AC| = |BD|$). Alternatively, verify opposite sides are equal and check if the Pythagorean theorem holds for one of the corner triangles (e.g., $|AB|^2 + |BC|^2 = |AC|^2$).
- Rhombus: All four sides are equal in length ($|AB| = |BC| = |CD| = |DA|$). The diagonals generally have different lengths and are perpendicular bisectors of each other (perpendicularity checked using slopes/vectors).
- Square: A rhombus with equal diagonals. So, all four sides are equal ($|AB| = |BC| = |CD| = |DA|$), and the diagonals are equal ($|AC| = |BD|$). This implies it is both a rectangle and a rhombus.
4. Finding Points Equidistant from Given Points
The distance formula is used to set up equations when a point is equidistant from other given points. This can lead to finding the equation of a locus or the coordinates of a specific point satisfying the condition.
- The locus of a point in 3D space equidistant from two fixed points P and Q is the perpendicular bisector plane of the segment PQ. If $A(x,y,z)$ is any such point, then $|AP| = |AQ|$, which leads to $|AP|^2 = |AQ|^2$. Expanding this using the distance formula gives a linear equation in x, y, and z, representing a plane.
- You might be asked to find a point on a specific axis or plane that is equidistant from given points.
Example 3. Find a point on the x-axis which is equidistant from the points P(1, 2, 3) and Q(3, -1, 2).
Answer:
Let the required point on the x-axis be A. Any point on the x-axis has its y and z coordinates equal to 0. So, the coordinates of A are $(x, 0, 0)$.
We are given that A is equidistant from point P(1, 2, 3) and point Q(3, -1, 2).
This means the distance from A to P is equal to the distance from A to Q: $|AP| = |AQ|$.
Squaring both sides, we get $|AP|^2 = |AQ|^2$. This is easier to work with as it removes the square roots.
Calculate $|AP|^2$:
Using A$(x, 0, 0)$ and P$(1, 2, 3)$: $|AP|^2 = (x - 1)^2 + (0 - 2)^2 + (0 - 3)^2$
$|AP|^2 = (x - 1)^2 + (-2)^2 + (-3)^2$
$|AP|^2 = (x - 1)^2 + 4 + 9 = (x - 1)^2 + 13$
$|AP|^2 = (x - 1)^2 + 13$
... (i)
Calculate $|AQ|^2$:
Using A$(x, 0, 0)$ and Q$(3, -1, 2)$: $|AQ|^2 = (x - 3)^2 + (0 - (-1))^2 + (0 - 2)^2$
$|AQ|^2 = (x - 3)^2 + (0 + 1)^2 + (-2)^2$
$|AQ|^2 = (x - 3)^2 + 1^2 + 4 = (x - 3)^2 + 1 + 4 = (x - 3)^2 + 5$
$|AQ|^2 = (x - 3)^2 + 5$
... (ii)
Set $|AP|^2 = |AQ|^2$ and Solve for x:
$(x - 1)^2 + 13 = (x - 3)^2 + 5$
($|AP|^2 = |AQ|^2$)
Expand the squared terms:
$(x^2 - 2x + 1) + 13 = (x^2 - 6x + 9) + 5$
... (iii)
Simplify equation (iii):
$x^2 - 2x + 14 = x^2 - 6x + 14$
... (iv)
Subtract $x^2$ from both sides of equation (iv):
$-2x + 14 = -6x + 14$
... (v)
Subtract 14 from both sides of equation (v):
$-2x = -6x$
... (vi)
Move the $-6x$ term to the left side of equation (vi):
$-2x + 6x = 0$
$4x = 0$
... (vii)
Solve equation (vii) for $x$:
$x = 0$
... (viii)
The x-coordinate of the point on the x-axis is 0. Since it is on the x-axis, its y and z coordinates are already 0. The coordinates of the point are $(0, 0, 0)$.
The point on the x-axis which is equidistant from P(1, 2, 3) and Q(3, -1, 2) is the origin (0, 0, 0).